{template 'web/common/common'}
{template 'web/distribution/navbar'}
<link rel="stylesheet" type="text/css" href="../addons/kundian_farm/resource/css/layui.css" />
<link rel="stylesheet" type="text/css" href="../addons/kundian_farm/resource/css/new-common.css" />

<form class="layui-form" action="{url 'site/entry/distribution',array('m'=>'kundian_farm','op'=>'distribution_set_save','version_id'=>$_GPC['version_id'])}" method="post">
    <div class="panel panel-info">
        <div class="panel-heading">
            <h3 class="panel-title"><p>提示：</p>
                <p>1、当前分销板块支持只支持二级分销。</p>
                <p>2、当前分销板块支持商城、组团商城、畜牧认养、租赁土地。</p>
                <p>3、分销模式：用户申请成为分销商后、发展分销下线、分销下线在商城中购买商品订单完成之后，该一级分销商和二级分销商可获得相应佣金（佣金=订单总金额*分销佣金/%）。</p>
                <p>4、目前分销佣金提现方式暂时支持支付宝转账。</p>
            </h3>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否开启分销</label>
        <div class="layui-input-block">
            {if $list['is_open_distribution']==1}
            <input type="checkbox" checked name="is_open_distribution" value="1" lay-skin="switch" lay-text="ON|OFF">
            {else}
            <input type="checkbox" name="is_open_distribution" value="1" lay-skin="switch" lay-text="ON|OFF">
            {/if}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">申请是否需要审核</label>
        <div class="layui-input-block">
            {if $list['is_check_distribution']==1}
            <input type="checkbox" checked name="is_check_distribution" value="1" lay-skin="switch" lay-text="ON|OFF">
            {else}
            <input type="checkbox" name="is_check_distribution" value="1" lay-skin="switch" lay-text="ON|OFF">
            {/if}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">一级佣金(%)</label>
        <div class="layui-input-block" style="width: 150px;">
            <input type="number" name="distribution_one_price" value="{$list['distribution_one_price']}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">二级佣金(%)</label>
        <div class="layui-input-block" style="width: 150px;">
            <input type="number" name="distribution_two_price" value="{$list['distribution_two_price']}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">最少提现额度(元)</label>
        <div class="layui-input-block" style="width: 150px;">
            <input type="text" name="distribution_withdraw_low_price" value="{$list['distribution_withdraw_low_price']}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">申请页面封面(375*200)</label>
        <div class="layui-input-block" style="width: 70%;">
            {php echo tpl_form_field_image('distribution_cover',$list['distribution_cover']);}
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">申请协议</label>
        <div class="layui-input-block" style="width: 70%;">
            <textarea placeholder="" name="distribution_agreement" class="layui-textarea">{$list['distribution_agreement']}</textarea>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="demo1">保存</button>
        </div>
    </div>
</form>
<script src="../addons/kundian_farm/resource/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });
        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });

    });
</script>


